/*
 * Created on May 4, 2009
 * 
 */
package com.etasist.util;

import com.etasist.StringEncrypter;
import com.etasist.StringEncrypter.EncryptionException;

/**
 * @author issa
 * 
 */
public class StringEncrypterUtil {

	public static void main(String[] args) {
		if (args.length < 1) {

			System.out.println(
				"Usage: com.etasist.util.StringEncrypterUtil <encryptionKey> <password to encrypt>");
			System.exit(-1);
		}
		
		String password			= args[0];
		
		try {
			String encryptionScheme = StringEncrypter.DESEDE_ENCRYPTION_SCHEME;

			StringEncrypter encrypter = new StringEncrypter(encryptionScheme, StringEncrypter.DEFAULT_ENCRYPTION_KEY);
			String encryptedPassword = encrypter.encrypt(password);
			System.out.println("encryptionKey>" +  StringEncrypter.DEFAULT_ENCRYPTION_KEY + "<\n"+
								"password>"+password+"<\n"+
								"encypted password>"+encryptedPassword+"<\n");

		} catch (EncryptionException e) {
			e.printStackTrace();
		}

	}
}
